package com.car.bean;

import java.util.HashMap;

public class PageObj {
	private String limit = "10";
	private String start = "0";
	
	public PageObj(){
		
	}
	public PageObj(String start,String limit){
		this.start=start;
		this.limit=limit;
	}
	
	public String getLimit() {
		return limit;
	}

	public void setLimit(String limit) {
		this.limit = limit;
	}

	public String getStart() {
		return start;
	}

	public void setStart(String start) {
		this.start = start;
	}

	public int getLimitInt() {
		int limitInt;
		try {
			limitInt = Integer.parseInt(limit);
		} catch (Exception e) {
			limitInt = 0;
		}
		return limitInt;
	}

	public int getStartInt() {
		int startInt;
		try {
			startInt = Integer.parseInt(start);
		} catch (Exception e) {
			startInt = 0;
		}
		return startInt;
	}

	public HashMap<String, Integer> toMap() {

		HashMap<String, Integer> map = new HashMap<String, Integer>();

		if(start==null || start.equals("")){
			start="0";
		}
		map.put("limit", Integer.parseInt(limit));

		map.put("start", Integer.parseInt(start));

		return map;
	}
}
